# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=pcmanfm-qt
pkgver=1.1.0
pkgrel=0
pkgdesc="Qt port of pcmanfm"
url="https://github.com/lxqt/pcmanfm-qt"
arch="all !s390x !armhf" # s390x blocked by libfm-qt
license="LGPL-2.0-or-later"
depends="desktop-file-utils paper-icon-theme lxmenu-data"
makedepends="
	cmake samurai lxqt-build-tools menu-cache-dev
	qt5-qttools-dev libfm-qt-dev libexif-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
source="https://github.com/lxqt/pcmanfm-qt/releases/download/$pkgver/pcmanfm-qt-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/$pkgname/translations
}

sha512sums="
b453b56bd10a94b6c4cbf6e999a470208c7817384f3868ef230a65d39ff3b1e2b2e6db8c08ca894c4e226288efd38dbdddeb1294fa4f8507836cf84594b956ef  pcmanfm-qt-1.1.0.tar.xz
"
